#ifndef TOOL_H
#define TOOL_H
#include <stdint.h>

typedef enum
{
    Pt_Normal=0,
    Pt_Open=1,
    Pt_Short=2,
    Pt_LowTemp=4,
    Pt_HighTemp=8,

    //负载反馈报错, 优先级高于其他报错
    Pt_ErA = 0xa, //马达负载报错  //APP：Motor is loose or wrong connetion ,Please check it.
    Pt_ErF = 0xb, //风扇负载报错 //APP：Fan is loose or wrong connetion ,Please check it.
    Pt_Eri = 0xc, //点火棒负载报错 //APP：Ignitor is loose or wrong connetion ,Please check it.
}_Pt_Status;

double AD_Convert_R(uint32_t ad);
double V_Convert_R(uint32_t vdd,uint32_t v);
double Quadratic(float R_x);
double CTemp_Convert_FTemp(double F_temp);
float InvSqrt(float number);


typedef enum
{
    Pt1000_Normal = 0, //Pt1000正常
    Pt1000_Short, //Pt1000短路
    Pt1000_Open, //Pt1000开路
}_Pt1000_State;
extern _Pt1000_State Pt1000_State;



#endif
